3.209 \(\int (a \cos (e+f x))^m (B \cos (e+f x)+C \cos ^2(e+f x)) \, dx\)

Optimal. Leaf size=141 \[ -\frac{B \sin (e+f x) (a \cos (e+f x))^{m+2} \, _2F_1\left (\frac{1}{2},\frac{m+2}{2};\frac{m+4}{2};\cos ^2(e+f x)\right )}{a^2 f (m+2) \sqrt{\sin ^2(e+f x)}}-\frac{C \sin (e+f x) (a \cos (e+f x))^{m+3} \, _2F_1\left (\frac{1}{2},\frac{m+3}{2};\frac{m+5}{2};\cos ^2(e+f x)\right )}{a^3 f (m+3) \sqrt{\sin ^2(e+f x)}} \]

[Out]

-((B*(a*Cos[e + f*x])^(2 + m)*Hypergeometric2F1[1/2, (2 + m)/2, (4 + m)/2, Cos[e + f*x]^2]*Sin[e + f*x])/(a^2*
f*(2 + m)*Sqrt[Sin[e + f*x]^2])) - (C*(a*Cos[e + f*x])^(3 + m)*Hypergeometric2F1[1/2, (3 + m)/2, (5 + m)/2, Co
s[e + f*x]^2]*Sin[e + f*x])/(a^3*f*(3 + m)*Sqrt[Sin[e + f*x]^2])

________________________________________________________________________________________

Rubi [A]  time = 0.13511, antiderivative size = 141, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 3, integrand size = 30, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.1, Rules used = {3010, 2748, 2643} \[ -\frac{B \sin (e+f x) (a \cos (e+f x))^{m+2} \, _2F_1\left (\frac{1}{2},\frac{m+2}{2};\frac{m+4}{2};\cos ^2(e+f x)\right )}{a^2 f (m+2) \sqrt{\sin ^2(e+f x)}}-\frac{C \sin (e+f x) (a \cos (e+f x))^{m+3} \, _2F_1\left (\frac{1}{2},\frac{m+3}{2};\frac{m+5}{2};\cos ^2(e+f x)\right )}{a^3 f (m+3) \sqrt{\sin ^2(e+f x)}} \]

Antiderivative was successfully verified.

[In]

Int[(a*Cos[e + f*x])^m*(B*Cos[e + f*x] + C*Cos[e + f*x]^2),x]

[Out]

-((B*(a*Cos[e + f*x])^(2 + m)*Hypergeometric2F1[1/2, (2 + m)/2, (4 + m)/2, Cos[e + f*x]^2]*Sin[e + f*x])/(a^2*
f*(2 + m)*Sqrt[Sin[e + f*x]^2])) - (C*(a*Cos[e + f*x])^(3 + m)*Hypergeometric2F1[1/2, (3 + m)/2, (5 + m)/2, Co
s[e + f*x]^2]*Sin[e + f*x])/(a^3*f*(3 + m)*Sqrt[Sin[e + f*x]^2])

Rule 3010

Int[((b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*((B_.)*sin[(e_.) + (f_.)*(x_)] + (C_.)*sin[(e_.) + (f_.)*(x_)]^2), x
_Symbol] :> Dist[1/b, Int[(b*Sin[e + f*x])^(m + 1)*(B + C*Sin[e + f*x]), x], x] /; FreeQ[{b, e, f, B, C, m}, x
]

Rule 2748

Int[((b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((c_) + (d_.)*sin[(e_.) + (f_.)*(x_)]), x_Symbol] :> Dist[c, Int[(b*S
in[e + f*x])^m, x], x] + Dist[d/b, Int[(b*Sin[e + f*x])^(m + 1), x], x] /; FreeQ[{b, c, d, e, f, m}, x]

Rule 2643

Int[((b_.)*sin[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Simp[(Cos[c + d*x]*(b*Sin[c + d*x])^(n + 1)*Hypergeomet
ric2F1[1/2, (n + 1)/2, (n + 3)/2, Sin[c + d*x]^2])/(b*d*(n + 1)*Sqrt[Cos[c + d*x]^2]), x] /; FreeQ[{b, c, d, n
}, x] &&  !IntegerQ[2*n]

Rubi steps

\begin{align*} \int (a \cos (e+f x))^m \left (B \cos (e+f x)+C \cos ^2(e+f x)\right ) \, dx &=\frac{\int (a \cos (e+f x))^{1+m} (B+C \cos (e+f x)) \, dx}{a}\\ &=\frac{B \int (a \cos (e+f x))^{1+m} \, dx}{a}+\frac{C \int (a \cos (e+f x))^{2+m} \, dx}{a^2}\\ &=-\frac{B (a \cos (e+f x))^{2+m} \, _2F_1\left (\frac{1}{2},\frac{2+m}{2};\frac{4+m}{2};\cos ^2(e+f x)\right ) \sin (e+f x)}{a^2 f (2+m) \sqrt{\sin ^2(e+f x)}}-\frac{C (a \cos (e+f x))^{3+m} \, _2F_1\left (\frac{1}{2},\frac{3+m}{2};\frac{5+m}{2};\cos ^2(e+f x)\right ) \sin (e+f x)}{a^3 f (3+m) \sqrt{\sin ^2(e+f x)}}\\ \end{align*}

Mathematica [A]  time = 0.252161, size = 118, normalized size = 0.84 \[ -\frac{\sqrt{\sin ^2(e+f x)} \cos (e+f x) \cot (e+f x) (a \cos (e+f x))^m \left (B (m+3) \, _2F_1\left (\frac{1}{2},\frac{m+2}{2};\frac{m+4}{2};\cos ^2(e+f x)\right )+C (m+2) \cos (e+f x) \, _2F_1\left (\frac{1}{2},\frac{m+3}{2};\frac{m+5}{2};\cos ^2(e+f x)\right )\right )}{f (m+2) (m+3)} \]

Antiderivative was successfully verified.

[In]

Integrate[(a*Cos[e + f*x])^m*(B*Cos[e + f*x] + C*Cos[e + f*x]^2),x]

[Out]

-((Cos[e + f*x]*(a*Cos[e + f*x])^m*Cot[e + f*x]*(B*(3 + m)*Hypergeometric2F1[1/2, (2 + m)/2, (4 + m)/2, Cos[e
+ f*x]^2] + C*(2 + m)*Cos[e + f*x]*Hypergeometric2F1[1/2, (3 + m)/2, (5 + m)/2, Cos[e + f*x]^2])*Sqrt[Sin[e +
f*x]^2])/(f*(2 + m)*(3 + m)))

________________________________________________________________________________________

Maple [F]  time = 1.489, size = 0, normalized size = 0. \begin{align*} \int \left ( a\cos \left ( fx+e \right ) \right ) ^{m} \left ( B\cos \left ( fx+e \right ) +C \left ( \cos \left ( fx+e \right ) \right ) ^{2} \right ) \, dx \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a*cos(f*x+e))^m*(B*cos(f*x+e)+C*cos(f*x+e)^2),x)

[Out]

int((a*cos(f*x+e))^m*(B*cos(f*x+e)+C*cos(f*x+e)^2),x)

________________________________________________________________________________________

Maxima [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int{\left (C \cos \left (f x + e\right )^{2} + B \cos \left (f x + e\right )\right )} \left (a \cos \left (f x + e\right )\right )^{m}\,{d x} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a*cos(f*x+e))^m*(B*cos(f*x+e)+C*cos(f*x+e)^2),x, algorithm="maxima")

[Out]

integrate((C*cos(f*x + e)^2 + B*cos(f*x + e))*(a*cos(f*x + e))^m, x)

________________________________________________________________________________________

Fricas [F]  time = 0., size = 0, normalized size = 0. \begin{align*}{\rm integral}\left ({\left (C \cos \left (f x + e\right )^{2} + B \cos \left (f x + e\right )\right )} \left (a \cos \left (f x + e\right )\right )^{m}, x\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a*cos(f*x+e))^m*(B*cos(f*x+e)+C*cos(f*x+e)^2),x, algorithm="fricas")

[Out]

integral((C*cos(f*x + e)^2 + B*cos(f*x + e))*(a*cos(f*x + e))^m, x)

________________________________________________________________________________________

Sympy [F(-1)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a*cos(f*x+e))**m*(B*cos(f*x+e)+C*cos(f*x+e)**2),x)

[Out]

Timed out

________________________________________________________________________________________

Giac [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int{\left (C \cos \left (f x + e\right )^{2} + B \cos \left (f x + e\right )\right )} \left (a \cos \left (f x + e\right )\right )^{m}\,{d x} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a*cos(f*x+e))^m*(B*cos(f*x+e)+C*cos(f*x+e)^2),x, algorithm="giac")

[Out]

integrate((C*cos(f*x + e)^2 + B*cos(f*x + e))*(a*cos(f*x + e))^m, x)